<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="css/aui.css">
    <link rel="stylesheet" href="css/style.css">
    <script type="text/javascript" src="js/jquery-3.3.1.min.js"></script>
    <script type="text/javascript" src="js/init.js"></script>
    <title>提现记录</title>
</head>
<body>
<header>
    <a href="javascript:history.back(-1)" class="f1 head-back"></a>
    <div class="f8">提现记录</div>
    <div class="f1"></div>
</header>

<section class="bg-gray">
    <div class="pad-3">
        <div class="flex flex-stretch space-btw">
            <a href="tixian.html" class="pad-1-2 bg-white border-radius-1 border-gray"><b>+</b>货币提现</a>
            <ul class="col-3 bg-white border-gray border-radius-1 flex">
                <li class="f1 border-r-gray">
                    <img class="col-3 auto" src="img/icon1.png" alt="" >
                </li>
                <li class="f1">
                    <img class="col-5 auto" src="img/icon2.png" alt="" >
                </li>
            </ul>
        </div>
        <div class="right mar-t-b-2">
            <input class="col-5 bg-white pad-1-2 border-radius-1 border-gray" type="search" placeholder="搜索">
        </div>

        <ul class="awardlist line-h-2 border-gray">
            <!--<li class="border-b-gray">
                <div>
                    <p>序号</p>
                    <p>2019-07-22</p>
                </div>
                <div>
                    <p>会员编号</p>
                    <p>10.22</p>
                </div>
                <div>
                    <p>时间</p>
                    <p>2.11</p>
                </div>
                <div>
                    <p>类型</p>
                    <p>0.00</p>
                </div>
                <div>
                    <p>金额</p>
                    <p class="color-green">0.00</p>
                </div>
                <div>
                    <p>地址</p>
                    <p>0.00</p>
                </div>
                <div>
                    <p>状态</p>
                    <p>
                        <span class="pad-l-r-1 color-white font25 bg-yellow">未确认</span>
                    </p>
                </div>
                <div>
                    <p>状态</p>
                    <p>
                        <span class="pad-l-r-1 color-white font25 bg-red">撤销</span>
                    </p>
                </div>
            </li>-->

        </ul>

    </div>
</section>

<div class="mask none"></div>
<div class="mask-box bg-white border-radius-1 pad-3 center none" style="width: 80%">
    <p class="pad-t-2 pad-b-3">确定要撤销提现？</p>
    <div class="pad-t-b-3">
        <span id="cancel" class="bg-gray pad-2-5 border-radius-1 mar-r-5" >取消</span>
        <span id="isrevoke" class="bg-blue pad-2-5 border-radius-1 color-white" >确定</span>
    </div>
</div>

<script src="js/foot.js"></script>
<script>
    var data;
    new AjaxRequest({
        type: 'post',
        dataType: 'json',
        url: hostUrl + 'index/Withdraw/detailed',
        data: data,
        callback: res => {

            if(res.status == 1){
                var list = '';
                for(var i=0;i<res.data.length;i++){
                    list += '<li class="border-b-gray"><div><p>序号</p><p>'+res.data[i].id+'</p></div><div><p>会员编号</p><p>'+res.data[i].user_id+'</p></div><div><p>时间</p><p>'+res.data[i].creattime+'</p></div><div><p>币种</p><p>'+res.data[i].coin_type+'</p></div><div><p>金额</p><p class="color-green">'+(res.data[i].extract_money?res.data[i].extract_money:0)+'</p></div><div><p>状态</p><p><span class="pad-l-r-1 color-white font25 bg-yellow">'+(res.data[i].status==1?'提现中':res.data[i].status==2?'提现成功':res.data[i].status==3?'提现失败':res.data[i].status==4?'已撤销':'')+'</span></p></div><div><p>状态</p><p>';

                    if(res.data[i].status == 1){
                        list += '<span onclick="revoke('+res.data[i].id+')" class="pad-l-r-1 font25 bg-red color-white">'+(res.data[i].status==1?'撤销':'')+'</span>';
                    }
                    list += '</p></div><div><p>说明</p><p><span class="pad-l-r-1 font25 ">'+(res.data[i].falimessages?res.data[i].falimessages:'')+'</span></p></div><div><p>手续费</p><p><span class="pad-l-r-1 font25 ">'+(res.data[i].factorage?res.data[i].factorage:0)+'</span></p></div><div><p>实际到账金额</p><p><span class="pad-l-r-1 font25 ">'+(res.data[i].actual_money?res.data[i].actual_money:0)+'</span></p></div></li>'
                }
                $(".awardlist").html(list);

            }
        }
    });

    var txid;
    function revoke(id) {

        $(".mask").show();
        $(".mask-box").show();
        txid =  id
    }

    $("#isrevoke").click(function () {

        var data = {
            userid: localStorage.user_id,
            token: localStorage.token,
            txid: txid,
        };
        new AjaxRequest({
            type: 'post',
            dataType: 'json',
            url: hostUrl + 'index/Withdraw/repeal',
            data: data,
            isShowLoader: true,
            callback: res => {
                toast(res.msg);
                if(res.status == 1){

                    $(".mask").hide();

                    $(".mask-box").hide();

                    setTimeout(function () {
                        location.reload();
                    },1000)


                }
            }
        });

    });


    $("#cancel").click(function () {
        $(".mask").hide();
        $(".mask-box").hide();

    });

</script>
</body>
</html>

